load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
    name = "color_service_proto",
    srcs = ["color_service.proto"],
    deps = [
        "@go_googleapis//google/rpc:status_proto",
        "@go_googleapis//google/type:color_proto",
    ],
)

go_proto_library(
    name = "color_service_go_proto",
    compilers = ["@io_bazel_rules_go//proto:go_grpc"],
    importpath = "github.com/bazelbuild/rules_go/tests/integration/googleapis/color_service_proto",
    proto = ":color_service_proto",
    deps = [
        "@go_googleapis//google/rpc:status_go_proto",
        "@go_googleapis//google/type:color_go_proto",
    ],
)

go_library(
    name = "color_service",
    srcs = ["color_service.go"],
    importpath = "github.com/bazelbuild/rules_go/tests/integration/googleapis/color_service",
    deps = [
        ":color_service_go_proto",
        "@go_googleapis//google/rpc:code_go_proto",
        "@go_googleapis//google/rpc:status_go_proto",
        "@go_googleapis//google/type:color_go_proto",
    ],
)

go_test(
    name = "color_service_test",
    srcs = ["color_service_test.go"],
    deps = [
        ":color_service",
        ":color_service_go_proto",
        "@go_googleapis//google/type:color_go_proto",
        "@org_golang_google_grpc//:go_default_library",
    ],
)
